package alex.cicy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created by Alex on 2015/3/12.
 */
@Component
public class AppContext {

    private static AppContext appContext;

    @Autowired
    private ApplicationContext applicationContext;

    @PostConstruct
    public void init() {
        appContext = this;
    }
    public static ApplicationContext getAppContext() {
        return appContext.applicationContext;
    }
}
